package com.example.second.controller;

import com.example.second.service.IStorageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
public class StorageController {

    @Autowired
    private IStorageService iStorageService;
    //主要用于后台增加库存
    @RequestMapping("/insertstorage/{skuid}/{inquanty}/{outquanty}")
    public Map<String,Object> insertStorage(@PathVariable("skuid") String sku_id,
                                            @PathVariable("inquanty") Double in_quanty,
                                            @PathVariable("outquanty") Double out_quanty){
        //验证用户身份
        return iStorageService.insertStorge(sku_id, in_quanty, out_quanty);
    }
}
